﻿@using GSLMS.Entity.Enum
@using GSLMS.WebAPP
@model GSLMS.Entity.TB_APP_PROINFO
@{
    Layout = null;
    var bussType = ViewData["RegBussType"] as SelectList;
    var loanReturn = Model.ProLoanRetuen ?? new List<GSLMS.Entity.TB_LOAN_RETURN>();
    var ShareHolderInfos = Model.ProReportSHInfo ?? new List<GSLMS.Entity.TB_APP_PROREPORTSHINFO>();
    var ProCheckObj = Model.ProCheckObj ?? new List<GSLMS.Entity.TB_APP_PROCHECKOBJINFO>();
    int index = 0;
    int checkIndex=0;
    int cIndex = 0;

    Model.ProUnForHouInfo = Model.ProUnForHouInfo ?? new GSLMS.Entity.TB_APP_PROUNFORHOUINFO();
    Model.ProCheckInfo = Model.ProCheckInfo ?? new List<GSLMS.Entity.TB_APP_PROCHECKINFO>();

    var isShowButtonBar = Model.ProReport.STATUS == 1?false:true;
}
<div class="pageContent">
    <form method="post"  id="proReportForm" action="DianDang/Apply/ProInfo/ReportInfo?OpID=@ViewData["OperateID"]" class="pageForm required-validate"
    onsubmit="return validateCallback(this, dialogAjaxDone)">
    @Html.HiddenFor(c=>c.ID)
    @Html.HiddenFor(c=>c.REGINFOID)
    <div class="pageFormContent" layoutH="60">
        @Html.HiddenFor(model => model.ID)
        @Html.HiddenFor(c => c.REGINFOID)
        <p>
            <label>
                申请编号：</label>
            @Html.ValueFor(model => model.APPLYNO)
        </p>
        <p>
            <label>
                借款人名称：</label>
            @Html.ValueFor(model => model.CUSTNAME)
        </p>
        <p>
            <label>
                借款金额：</label>
            @Html.ValueFor(model => model.AMOUNT)
                万元
        </p>
        <p>
            <label>
                贷款期限：</label>
            @Html.ValueFor(model => model.LOANPHASE)
            @(Model.LOANPHAESTYPE == 0 ? "天" : "月")
        </p>
        <p>
            <label>
                还款方式：</label>
            @((ApplyEnum.ProRepayment)Model.ProUnForHouInfo.REPAYMENT)
        </p>
        <p>
            <label>
                预收费用：</label>
            @Html.ValueFor(model => model.LOANFEE)
            元
        </p>
        <p>
            <label>
                业务人员：</label>
            @Html.ValueFor(model => model.SALESMAN)
        </p>
        <p>
            <label>
                受理日期：</label>
            @Html.ValueFor(model => model.APPDATE)
        </p>
        <p>
            <label>
                业务来源：</label>
            @Html.ValueFor(model => model.SOURCE)
        </p>
        <p>
            <label>
                项目性质：</label>
                @((GSLMS.Entity.Enum.ApplyEnum.RegBussType)Model.BUSSTYPE)
           @* @foreach (var item in bussType)
            {
                @Html.CheckBox("BUSSTYPE", Model.BUSSTYPE.ToString() == item.Value)
                <span>@item.Text&nbsp;</span>
            }*@
        </p>
        <p style="width: 95%; height: 50px">
            <label>
                业务情况简述：</label>
            @Html.HiddenFor(model => model.ProReport.ID)
            @Html.HiddenFor(model => model.ProReport.PROID)
            @Html.HiddenFor(model => model.ProReport.REGINFOID)
            @Html.HiddenFor(model => model.ProReport.STATUS)
            @Html.TextAreaFor(model => model.ProReport.BUSSDETAIL, new { @class = "", @maxlength = "3000", @style = "width:80%;" })
            @Html.ValidationMessageFor(model => model.ProReport.BUSSDETAIL)
            @Html.Hidden("HidReportStatus")
        </p>
        <p>
            <label>
                注册情况：</label>
            @Html.TextBoxFor(model => model.ProReport.REGDETAIL)
            @Html.ValidationMessageFor(model => model.ProReport.REGDETAIL)
        </p>
        <p>
            <label>
                企业名称：</label>
            @Html.TextBoxFor(model => model.ProReport.CORPNAME)
            @Html.ValidationMessageFor(model => model.ProReport.CORPNAME)
        </p>
        <p>
            <label>
                成立时间：</label>
            @Html.TextBoxFor(model => model.ProReport.CREATEDATE, new { @class = "date", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd", @size = "16", @fieldclass = "required" })
            <a class="inputDateButton" href="javascript:;" maxDate = "%y-%M-%d">选择</a>
            @Html.ValidationMessageFor(model => model.ProReport.CREATEDATE)
        </p>
        <p>
            <label>
                注册资本：</label>
            @Html.TextBoxFor(model => model.ProReport.REGCAPTAIL)
            万元
            @Html.ValidationMessageFor(model => model.ProReport.REGCAPTAIL)
        </p>
        <p>
            <label>
                法定代表人：</label>
            @Html.TextBoxFor(model => model.ProReport.LEGALMAN, new { @readonly = "true" })
        </p>
        <p>
            <label>
                经营期限：</label>
            @Html.TextBoxFor(model => model.ProReport.BUSSTERM)
            年
            @Html.ValidationMessageFor(model => model.ProReport.BUSSTERM)
        </p>
        <p>
            <label>
                贷款卡号：</label>
            @Html.TextBoxFor(model => model.ProReport.LOANNO)
            @Html.ValidationMessageFor(model => model.ProReport.LOANNO)
        </p>
        <p>
            <label>
                实际控制人：</label>
            @Html.TextBoxFor(model => model.ProReport.CONBY, new { @readonly = "true" })
        </p>
        <p style="width: 95%; height: 50px">
            <label>
                年检情况：</label>
            @Html.TextAreaFor(model => model.ProReport.ANNCHECK, new { @class = "", @maxlength = "50", @style = "width:80%;" })
            @Html.ValidationMessageFor(model => model.ProReport.ANNCHECK)
        </p>
        <p>
            <label>
                注册地址：</label>
            @Html.TextBoxFor(model => model.ProReport.REGADDR)
            @Html.RadioButtonFor(model => model.ProReport.REGADDRTYPE, "自有")
            <span>自有&nbsp;</span>
            @Html.RadioButtonFor(model => model.ProReport.REGADDRTYPE, "租赁")
            <span>租赁&nbsp;</span>
            @Html.ValidationMessageFor(model => model.ProReport.REGADDR)
        </p>
        <p style="width:400px">
            <label>
                注册地址电话：</label>
            @Html.TextBoxFor(model => model.ProReport.REGTELCODE, new { @value = "0755", @style = "width:50px", @alt = "区号" })
            @Html.TextBoxFor(model => model.ProReport.REGTEL, new { })
            @Html.TextBoxFor(model => model.ProReport.REGTELSUB, new { @style = "width:50px", @alt = "分机号" })
            @Html.ValidationMessageFor(model => model.ProReport.REGTEL)
        </p>
        <p>
            <label>
                办公地址：</label>
            @Html.TextBoxFor(model => model.ProReport.WORKADDR)
            @Html.RadioButtonFor(model => model.ProReport.SPAREFIELD1, "1")
            <span>自有&nbsp;</span>
            @Html.RadioButtonFor(model => model.ProReport.SPAREFIELD1, "2")
            <span>租赁&nbsp;</span>
            @Html.ValidationMessageFor(model => model.ProReport.WORKADDR)
        </p>
        <p style="width:400px">
            <label>
                办公地址电话：</label>
            @Html.TextBoxFor(model => model.ProReport.WORKTELCODE, new { @value = "0755", @style = "width:50px", @alt = "区号" })
            @Html.TextBoxFor(model => model.ProReport.WORKTEL, new { })
            @Html.TextBoxFor(model => model.ProReport.WORKTELSUB, new { @style = "width:50px", @alt = "分机号" })
            @Html.ValidationMessageFor(model => model.ProReport.WORKTEL)
        </p>
        <p>
            <label style="width:140px">
                是否需要特殊资质证书：</label>
            @Html.RadioButtonFor(model => model.ProReport.ISSPECAILCER, "0")
            <span>否&nbsp;</span>
            @Html.RadioButtonFor(model => model.ProReport.ISSPECAILCER, "1")
            <span>是&nbsp;</span>
            @Html.ValidationMessageFor(model => model.ProReport.ISSPECAILCER)
        </p>
        <p>
            <label>
                已取得资质证书：</label>
            @Html.TextBoxFor(model => model.ProReport.HAVESPECAILCERS, new { })
            @Html.ValidationMessageFor(model => model.ProReport.HAVESPECAILCERS)
        </p>
        <p>
            <label>
                法人代表实际住址：</label>
            @Html.TextBoxFor(model => model.ProReport.LEGALHOUADDR, new { })
            @Html.ValidationMessageFor(model => model.ProReport.LEGALHOUADDR)
        </p>
        <p>
            <label>
                法人代表电话：</label>
            @Html.TextBoxFor(model => model.ProReport.LEGALTEL, new { })
            @Html.ValidationMessageFor(model => model.ProReport.LEGALTEL)
        </p>
        <p style="width: 95%; height: 50px">
            <label>
                其他情况说明：</label>
            @Html.TextAreaFor(model => model.ProReport.OTHERREMARK, new { @class = "", @maxlength = "1000", @style = "width:80%;" })
            @Html.ValidationMessageFor(model => model.ProReport.OTHERREMARK)
        </p>
        <div class="divider"></div>
        <div class="title">
            <h5>
                股东及其他出资比例</h5>
            <table class="list nowrap itemDetail" addbutton="新建行" width="90%">
                <thead>
                    <tr>
                        <th type="text" name="ProReportSHInfo[#index#].NAME" size="12" fieldclass="required">
                                @Html.Hidden("ProReportSHInfo[#index#].ID",0)
                                @Html.Hidden("ProReportSHInfo[#index#].REGINFOID",Model.REGINFOID)
                                @Html.Hidden("ProReportSHInfo[#index#].PROID",Model.ID)
                                @Html.Hidden("ProReportSHInfo[#index#].REPORTID",0)
                            主要股东名称
                        </th>
                        <th type="text" name="ProReportSHInfo[#index#].ADDRESS" size="12" fieldclass="required">
                            现住址
                        </th>
                        <th type="text" name="ProReportSHInfo[#index#].TEL" size="12" fieldclass="required">
                            电话
                        </th>
                        <th type="text" name="ProReportSHInfo[#index#].FUNDED" size="12" fieldclass="">
                            出资方式
                        </th>
                        <th type="text" name="ProReportSHInfo[#index#].AMOUNT" size="12" fieldclass="number">
                            金额
                        </th>
                        <th type="text" name="ProReportSHInfo[#index#].RATIO" size="12" fieldclass="number">
                            股权比例
                        </th>
                        <th type="enum" name="ProReportSHInfo[#index#].ISPAYED" size="12" enumurl="DianDang/Apply/ProInfo/IsPayed">
                            是否到位
                        </th>
                        <th type="del" width="60">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in ShareHolderInfos)
                    { 
                        <tr>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].NAME", item.NAME, new { @style = "width:100px" })
                                @Html.Hidden("ProReportSHInfo[" + index + "].ID", item.ID)
                                @Html.Hidden("ProReportSHInfo[" + index + "].REGINFOID", item.REGINFOID)
                                @Html.Hidden("ProReportSHInfo[" + index + "].PROID", item.PROID)
                                @Html.Hidden("ProReportSHInfo["+index+"].REPORTID",item.REPORTID)
                            </td>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].ADDRESS", item.ADDRESS, new { @style = "width:100px" })
                            </td>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].TEL", item.TEL, new { @style = "width:100px" })
                            </td>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].FUNDED", item.FUNDED, new { @style = "width:100px" })
                            </td>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].AMOUNT", item.AMOUNT, new { @style = "width:100px", @class = "number" })
                            </td>
                            <td>@Html.TextBox("ProReportSHInfo["+index+"].RATIO", item.RATIO, new { @style = "width:100px", @class = "number" })
                            </td>
                            <td>
                                <select class="combox" name="ProReportSHInfo[@index].ISPAYED">
                                    <option value="0"  @(item.ISPAYED == 0 ? "selected" : "")>否</option>
                                    <option value="1"  @(item.ISPAYED == 1 ? "selected" : "")>是</option>
                                </select>
                            </td>
                            <td>
                              <a href="javascript:void(0)" class="btnDel">删除</a>
                            </td>
                        </tr>
                        index++;
                    }
                </tbody>
            </table>
        </div>
        <div class="divider"></div>
            @foreach (var checkItem in Model.ProCheckInfo)
            {
              <p style="width: 95%; height: 220px">
                    <label>
                        @checkItem.PRONAME：</label>
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].PROID", checkItem.PROID)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].ID", checkItem.ID)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].REGINFOID", checkItem.REGINFOID)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].REPORTID", checkItem.REPORTID)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].SORTNO", checkItem.SORTNO)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].PROCODE", checkItem.PROCODE)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].PRONAME", checkItem.PRONAME)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].SPAREFIELD1", checkItem.SPAREFIELD1)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].SPAREFIELD2", checkItem.SPAREFIELD2)
                    @Html.Hidden("ProCheckInfo[" + checkIndex + "].SPAREFIELD3", checkItem.SPAREFIELD3)
                    @Html.TextArea("ProCheckInfo[" + checkIndex + "].SURCONTEN", checkItem.SURCONTEN, new { @class = "editor",@tools="Cut,Copy,Paste,Pastetext,|,Blocktag,Fontface,FontSize,Bold,Italic,Underline,Strikethrough,FontColor,BackColor,|,Align,List,Outdent,Indent,Table,|,SelectAll,Removeformat,Preview,Fullscreen",@style = "width:80%;height:215px;" })

                </p>
               checkIndex++;
            }
         <div class="divider"></div>
      @*  @foreach (var item in Model.ProCheckInfo)
        {
            <p style="width: 95%; height: 50px">
                <label>
                    @item.PRONAME：</label>
                @Html.TextArea(string.Format("ProCheckInfo[{0}].{1}", index, item.PROCODE), item.SURCONTEN, new { @class = "", @style = "width:80%;" })
                @Html.ValidationMessageFor(model => model.ProReport.OTHERREMARK)
            </p>
            
            index += 1;
        }
         <div class="divider"></div>*@
        <div class="title">
            <h5>
                实地调查情况（包括客户、银行、政府部门等）</h5>
            <table class="list nowrap itemDetail" addbutton="新建行" width="90%">
                <thead>
                    <tr>
                        <th type="text" name="ProCheckObj[#index#].SURVEYOBJ" size="12" fieldclass="required">
                               @Html.Hidden("ProCheckObj[#index#].ID", 0)
                                @Html.Hidden("ProCheckObj[#index#].PROID", Model.ID)
                                @Html.Hidden("ProCheckObj[#index#].REGINFOID",Model.REGINFOID)
                                @Html.Hidden("ProCheckObj[#index#].REPORTID",0)
                            调查对象
                        </th>
                        <th type="date" format="yyyy-MM-dd" maxDate = "%y-%M-%d" formatDate = "yyyy-MM-dd" readonly = "true"   name="ProCheckObj[#index#].SURVEYTIME" size="16"
                            fieldclass="required">
                            调查时间
                        </th>
                        <th type="text" name="ProCheckObj[#index#].OWNERSURVEYBY" size="12" fieldclass="required">
                            我司参与调查人员
                        </th>
                        <th type="text" name="ProCheckObj[#index#].COUNTBY" size="12" fieldclass="">
                            对方接待人员
                        </th>
                        <th type="text" name="ProCheckObj[#index#].COUNTBYIND" size="12" fieldclass="">
                            对方接待人员身份
                        </th>
                        <th type="del" width="60">
                            操作
                        </th>
                    </tr>
                </thead>
                <tbody>
                    @foreach (var item in ProCheckObj)
                    { 
                        <tr>
                            <td>@Html.TextBox("ProCheckObj["+cIndex+"].SURVEYOBJ", item.SURVEYOBJ, new { @style = "width:100px" })
                                @Html.Hidden("ProCheckObj[" + cIndex + "].ID", item.ID)
                                @Html.Hidden("ProCheckObj[" + cIndex + "].PROID", item.PROID)
                                @Html.Hidden("ProCheckObj[" + cIndex + "].REGINFOID", item.REGINFOID)
                                @Html.Hidden("ProCheckObj[" + cIndex + "].REPORTID", item.REPORTID)
                            </td>
                            <td>@Html.TextBox("ProCheckObj[" + cIndex + "].SURVEYTIME", item.SURVEYTIME, new { @style = "width:100px", @class = "date", format = "yyyy-MM-dd", @maxDate = "%y-%M-%d", @readonly = "true", formatDate = "yyyy-MM-dd" })
                               <a class="inputDateButton" href="javascript:;">选择</a>
                            </td>
                            <td>@Html.TextBox("ProCheckObj[" + cIndex + "].OWNERSURVEYBY", item.OWNERSURVEYBY, new { @style = "width:100px" })
                            </td>
                            <td>@Html.TextBox("ProCheckObj[" + cIndex + "].COUNTBY", item.COUNTBY, new { @style = "width:100px" })
                            </td>
                            <td>@Html.TextBox("ProCheckObj[" + cIndex + "].COUNTBYIND", item.COUNTBYIND, new { @style = "width:100px", @class = "" })
                            </td>
                            <td>
                               <a href="javascript:void(0)" class="btnDel">删除</a>
                            </td>
                        </tr>
                        
                        cIndex++;
                    }
                </tbody>
            </table>
        </div>
    </div>

    @if (isShowButtonBar)
    {
   <div class="formBar">
                    <ul>
                        <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="button" onclick="sumbitReportInfo(0)">
                                        保存</button></div>
                            </div>
                        </li>
                         <li>
                            <div class="buttonActive">
                                <div class="buttonContent">
                                    <button type="button" onclick="sumbitReportInfo(1)">
                                        提交</button></div>
                            </div>
                        </li>
                    </ul>
                </div>
    }
    </form>
    
</div>
<script type="text/javascript">
    function sumbitReportInfo(type) {
        var form = $("#proReportForm");
        //var status = $("#ProReport.STATUS", form);
        //status.val(type);
        $("#HidReportStatus",form).val(type);
        $("#ProReport.STATUS", form).val(type);
        validateCallback(form, dialogAjaxDone,"您确定要提交此调查报告吗？");
    
     }
</script>
